package com.ljx.funchat.user.service.adatper;

import com.ljx.funchat.user.domain.entity.User;
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;

public class UserAdapter {
    public static User buildUserSave(String openid) {
        User user = new User();
        user.setOpenId(openid);
        return user;
    }

    public static User buildAuthorUser(Long uid, WxOAuth2UserInfo userInfo) {
        return User.builder().name(userInfo.getNickname())
                .avatar(userInfo.getHeadImgUrl())
                .id(uid)
                .build();
    }
}
